<input type="hidden" id="update_tweet_status" value="<?php echo $this->session->flashdata('update_tweet_status'); ?>" />
<script type="text/javascript">
  $(document).ready(function() {
    $('#tweet_message').wysihtml5({
      "html": true,
      "color": true
    });
    var update_tweet_status = $.trim($('#update_tweet_status').val());
    if (update_tweet_status == 2) {
      toastr.error('No changes made !');
      return false;
    }
  });
</script>

<div class="page" style="min-height: 500px;">
  <div class="page-container">
    <div class="container">
      <div class="row">
        <div class="span12 header">
          <div class="btn-group" style="float: right; margin-bottom: 10px;">
            <a href="<?php echo base_url('tweet/' . $tweet_id); ?>" class="btn">View tweet</a>
          </div>
          <h4>Update tweet</h4>
        </div>
        <div class="span6">
          <form method="post" action="<?php echo base_url('tweet/update/' . $tweet_id); ?>" class="form-horizontal" onsubmit="return confirm_action('Save & publish tweet ?');">
            <input type="hidden" name="csrf_token" value="<?php echo set_csrf_token(); ?>"/>
            <div class="control-group">
              <label class="control-label">Tweet subject </label>
              <div class="controls">
                <input name="tweet_subject" style="width: 235%;" id="tweet_subject" type="text" placeholder="Enter tweet subject (250)" value="<?php echo $tweet_subject; ?>"/>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Tweet message </label>
              <div class="controls" style="width: 166%;">
                <textarea name="tweet_message" id="tweet_message" style="width: 97%; height: 250px;" placeholder="Enter tweet message"><?php echo $tweet_message; ?></textarea> 
              </div>
            </div>
            <a class="badge badge-info" id="malayalam_button" style="float: right; cursor: pointer; margin-right: -535px; text-decoration: none;" onclick="return write_malayalam('tweet_message');">malaylam</a>
            <div class="control-group"> 
              <div class="controls">
                <button type="submit" class="btn" onclick="return validate_tweet();">Update</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>